#ifndef PROXY_CORE_HTTP_HTTP_PARSER_H_
#define PROXY_CORE_HTTP_HTTP_PARSER_H_

#include "proxycore/base/basedefines.h"
#include "proxycore/parse/http_parser.h"
#include <vector>
#include <set>

namespace proxy{
  enum ParserState{
    PARSER_STATE_PARSERING,
    PARSER_STATE_ERROR,
    PARSER_STATE_COMPLETE
  };
  class HttpRequestParser{
  public:
    HttpRequestParser();
    virtual ~HttpRequestParser();
    std::size_t Parse(const char* data, int size);
    std::string error_message();
    ParserState State();
  private:
    void InitRequestParser();
  private:
    HttpRequest http_request_;
    http_parser parser_;
    http_parser_settings settings_;
    ParserState state_;
    std::set<std::string> remove_set_;
  };
}

#endif // PROXY_CORE_HTTP_HTTP_PARSER_H_